/********************************************************************
	File		: Assert.h
	Created		: 2011-4-5	1:56
	Author		: Wjl

	Desc		: This file is part of omiga 2d engine.
*********************************************************************/

#ifndef Assert_H__
#define Assert_H__

#include <string>

#ifdef DEBUG
#include <cassert>
#include <cstdio>
#include <cstdarg>
#endif

namespace Debug
{
#ifdef DEBUG
	inline void		Trace(const char* fmtStr, ...)
	{
		va_list vl;
		va_start(vl, fmtStr);
		vprintf(fmtStr, vl);
		va_end(vl);
	}

	inline void		Assert(bool bTrue, const std::string& info = "")
	{
		if (!bTrue)
		{
			Trace("Assert : --> %s\n", info.c_str());
			__asm
			{
				int 3; // debug break
			}
		}
	}
	
#else
	inline void		Assert(bool bTrue, const std::string& info = "")
	{

	}
	inline void		Trace(const char* fmtStr, ...)
	{

	}
#endif
}

#endif // Assert_H__